#include "widget.h"
#include "./ui_widget.h"
#include "book.h"

#include<QMessageBox>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    //初始化
    ui->username->setText("xxx");
    ui->userpwd->setText("xxx");


}

Widget::~Widget()
{
    delete ui;
}

void Widget::login(QString username, QString userpwd)
{

}

void Widget::newBookWidget()
{

}

void Widget::on_pushButton_clicked()
{
    //登录按钮

    if(ui->username->text()=="xxx"&&ui->userpwd->text()=="xxx"){
       QMessageBox::information(this,"登录","登录成功！");
        Book* mybook=new Book(this);
        this->close();
        mybook->show();

    }else{
        QMessageBox::information(this,"登录","登录失败！");
    }
    //登录之后跳转页面
    //newBookWidget();
}

